<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-industryMcc-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">MCC：</label>
				<div class="col-sm-8">
					<input id="industryMcc" name="industryMcc" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">行业名称：</label>
				<div class="col-sm-8">
					<input id="industryName" name="industryName" class="form-control" type="text">
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/industryMcc"
		$("#form-industryMcc-add").validate({
			rules:{
				industryMcc:{
					required:true,
					remote: {
						url: ctx + "system/industryMcc/checkIndustryMcc",
						type: "post",
						dataType: "json",
						data: {
							industryMcc: function () {
								return $.common.trim($("#industryMcc").val());
							},
							"id":""
						},
						dataFilter: function (data, type) {
							return $.validate.unique(data);
						}
					}
				},
				industryName:{
					required:true,
				},

			},
			messages: {
				"industryMcc": {
					remote: "MCC码已经存在"
				},
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-industryMcc-add').serialize());
	        }
	    }
	</script>
</body>
</html>
